<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>

</head>

<body>
	<div id="main">
		<div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('action'=>'index-'.$this->suffix)) ;?>">渠道申请列表</a>  &gt; <span id="focus">渠道申请</span></div>
  <div id="body">
			<div id="edit">
				<form id="editForm" name="editForm" method="post" action="">
					<table class="table">
						<tr class="dataLine">
						  <td width="400px">渠道的编号：</td>
						  <td><?php echo $this->memberCode;?><input name="memberCode" type="hidden" value="<?php echo $this->memberCode;?>" /></td>
					  </tr>
						<tr class="dataLine">
						  <td>选择产品：</td>
						  <td><select name="productCode" id="productCode" style="width:200px">
                          <option value="">选择</option>
							  <?php foreach($this->products as $product):?>
                                <option value="<?php echo $product['code'];?>"><?php echo $product['name'];?></option>
                              <?php endforeach;?>
					      </select>                          </td>
					  </tr>
					 <tr class="dataLine"  id="osNameNum">  
                     
					  </tr>
						<tr class="dataLine">
							<td>申请事由：</td>
							<td><textarea name="applyNotes" cols="30" rows="5" class="input" id="applyNotes" style="width:300px;"></textarea></td>
						</tr>
						<tr class="dataLine">
							<td>&nbsp;</td>
							<td><input type="submit" name="button" id="button" value="提交" class="button" /></td>
						</tr>
					</table>
			  </form>
			</div>
		</div>
</div>
<script>
$(function(){
	$("#productCode").change(function(){
		 $.ajax({ url: "<?php echo $this->projectUrl(array('controller'=>'source','action'=>'osnames'));?>",
              type:"post",           
             dataType:"json",
             data: "productCode="+$("#productCode option:selected").val(),
             success:function(data){ 
									var default_osName=$("#default_osName").val();
									var txt = '<td>操作系统以及软件包数量:</td><td>';
                                   $.each(data,function(i){
										txt+='<input type="checkbox" name="cbOsName[]" id="cbOsName[]" value="'+data[i]+'" />'+data[i]+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数量：<input name="applyNum['+data[i]+']" type="text" id="applyNum['+data[i]+']" size="8" /></br>';
									}); 
									 txt+='</td>';
									$("#osNameNum").html(txt);
                              } 
         });
	
	
	
	})
	
	$("#productCode").change();
	
})

</script>
</body>
</html>